package com.bling.common.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 分类简单操作业务逻辑
 * @author BLingSoft
 *
 */
@Entity
@Table(name="T_KIND")
public class Kind implements Serializable {

	private static final long serialVersionUID = -7702503054663392307L;

	private Integer id;//分类编号
	private Integer parentid;//上级分类编号
	private String name;//分类名称
	private Integer sort;//排序
	private Integer formid; //对应表单
	
	private Kind parentkind; // 父分类
	private List<Kind> childkind = new ArrayList<Kind>(); // 子分类集合
	private Form form; // 对应表单
	
	public Kind() {
		super();
	}
	public Kind(Integer parentid, String name, Integer sort, Integer formid) {
		super();
		this.parentid = parentid;
		this.name = name;
		this.sort = sort;
		this.formid = formid;
	}
	
	@Id
	@GeneratedValue
	@Column
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	@Column
	public Integer getParentid() {
		return parentid;
	}
	public void setParentid(Integer parentid) {
		this.parentid = parentid;
	}
	
	@Column(length=50)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	@Column
	public Integer getSort() {
		return sort;
	}
	public void setSort(Integer sort) {
		this.sort = sort;
	}
	
	@Column
	public Integer getFormid() {
		return formid;
	}
	public void setFormid(Integer formid) {
		this.formid = formid;
	}
	
	@Transient
	public Kind getParentkind() {
		return parentkind;
	}
	public void setParentkind(Kind parentkind) {
		this.parentkind = parentkind;
	}
	
	@Transient
	public List<Kind> getChildkind() {
		return childkind;
	}
	public void setChildkind(List<Kind> childkind) {
		this.childkind = childkind;
	}
	
	@Transient
	public Form getForm() {
		return form;
	}
	public void setForm(Form form) {
		this.form = form;
	}
}
